package com.mumu;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mumu.common.ds.DynamicDataSourceRegister;

/**
 * springboot启动器
 * @author CZH
 */
@Controller
// 扫描mapper
@MapperScan(basePackages = "com.mumu.*.dao")
// 启动注册动态数据源been
@Import({ DynamicDataSourceRegister.class })
// springboot启动
@SpringBootApplication
@EnableEurekaClient
public class MuSystemApplication extends SpringBootServletInitializer {

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(MuSystemApplication.class);
	}

	public static void main(String[] args) {
		SpringApplication.run(MuSystemApplication.class, args);
	}

	@RequestMapping("/")
	String home() {
		return "redirect:queryUserDefPage";
	}
}
